<template>
<div>
  <el-dialog title="批量添加" :visible.sync="open">
    <el-form :model="form">
      <el-form-item label="活动名称" :label-width="80">
      <file-upload
        ref="fileUpload"
        :limit="1"
        :fileType="['xls']"
      @input="hanldinput">

      </file-upload>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="open = false">取 消</el-button>
      <el-button type="primary" @click="submitForm">确 定</el-button>
    </div>
  </el-dialog>

</div>
</template>

<script>
  import FileUpload from '@/components/FileUpload'
  import {uploadClue} from '@/api/crm/clue'
    export default {
        name: "BatchAdd",
      components:{FileUpload},
      data(){
          return{
            form:{
              filename:''
            },
            open:false,

          }
      },
      methods:{
        hanldinput(filenames){
          this.form.filename=filenames
        },
        submitForm(){
          uploadClue(this.form).then(()=>{
          this.$modal.msgSuccess("操作成功");
          this.open=false;
          this.$emit("success")

        })
        }
      }
    }
</script>

<style scoped>

</style>
